package edu.psu.collegerecommendationtool.coreservlets;

import java.sql.SQLException;

import javax.faces.bean.*;
import javax.faces.context.FacesContext;

import edu.psu.collegerecommendationtool.model.UserBean;


@ManagedBean(name="mainBean")
public class MainPageBean {
   @ManagedProperty(value="#{userBean}")
   private UserBean user;

   public UserBean getUser() {
      return user;
   }
   public void setUser(UserBean user) {
      this.user = user;
   }

////////////////////////////////////////////////////////////////////////

   public String displayResultList() {
      return("CollegeResultPage");
   }

////////////////////////////////////////////////////////////////////////

   public String logout() throws SQLException, ClassNotFoundException {
      FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
      return "LogoutPage.xhtml?faces-redirect=true";

   }

}